|
1
|
|
|
/** global: Clipboard */ |
|
2
|
|
|
$(document).ready(function () { |
|
3
|
|
|
var clipboard = new Clipboard('.copy-link'); |
|
|
|
|
|
|
4
|
|
|
clipboard.on('success', function (e) { |
|
5
|
|
|
var $input = $(e.trigger); |
|
6
|
|
|
$input.tooltip('hide') |
|
7
|
|
|
.attr('data-original-title', t('core', 'Copied!')) |
|
8
|
|
|
.tooltip('fixTitle') |
|
9
|
|
|
.tooltip({placement: 'bottom', trigger: 'manual'}) |
|
10
|
|
|
.tooltip('show'); |
|
11
|
|
|
_.delay(function () { |
|
12
|
|
|
$input.tooltip('hide'); |
|
13
|
|
|
if (OC.Share.Social.Collection.size() === 0) { |
|
14
|
|
|
$input.attr('data-original-title', t('core', 'Copy')) |
|
15
|
|
|
.tooltip('fixTitle'); |
|
16
|
|
|
} else { |
|
17
|
|
|
$input.tooltip('destroy'); |
|
18
|
|
|
} |
|
19
|
|
|
}, 3000); |
|
20
|
|
|
}); |
|
21
|
|
|
clipboard.on('error', function (e) { |
|
22
|
|
|
var $input = $(e.trigger); |
|
23
|
|
|
var actionMsg = ''; |
|
24
|
|
|
if (/iPhone|iPad/i.test(navigator.userAgent)) { |
|
|
|
|
|
|
25
|
|
|
actionMsg = t('core', 'Not supported!'); |
|
26
|
|
|
} else if (/Mac/i.test(navigator.userAgent)) { |
|
27
|
|
|
actionMsg = t('core', 'Press ⌘-C to copy.'); |
|
28
|
|
|
} else { |
|
29
|
|
|
actionMsg = t('core', 'Press Ctrl-C to copy.'); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
$input.tooltip('hide') |
|
33
|
|
|
.attr('data-original-title', actionMsg) |
|
34
|
|
|
.tooltip('fixTitle') |
|
35
|
|
|
.tooltip({placement: 'bottom', trigger: 'manual'}) |
|
36
|
|
|
.tooltip('show'); |
|
37
|
|
|
_.delay(function () { |
|
38
|
|
|
$input.tooltip('hide'); |
|
39
|
|
|
if (OC.Share.Social.Collection.size() == 0) { |
|
|
|
|
|
|
40
|
|
|
$input.attr('data-original-title', t('core', 'Copy')) |
|
41
|
|
|
.tooltip('fixTitle'); |
|
42
|
|
|
} else { |
|
43
|
|
|
$input.tooltip("destroy"); |
|
44
|
|
|
} |
|
45
|
|
|
}, 3000); |
|
46
|
|
|
}); |
|
47
|
|
|
|
|
48
|
|
|
$('.alt-tooltip').tooltip(); |
|
49
|
|
|
|
|
50
|
|
|
$('.delete-poll').click(function () { |
|
51
|
|
|
deletePoll(this); |
|
|
|
|
|
|
52
|
|
|
}); |
|
53
|
|
|
|
|
54
|
|
|
$('.table-body .avatardiv').each(function (i, obj) { |
|
55
|
|
|
$(obj).avatar(obj.title, 32); |
|
56
|
|
|
}); |
|
57
|
|
|
|
|
58
|
|
|
$('.popupmenu').each(function () { |
|
59
|
|
|
OC.registerMenu($('#expand_' + $(this).attr('value')), $('#expanddiv_' + $(this).attr('value')) ); |
|
60
|
|
|
}); |
|
61
|
|
|
|
|
62
|
|
|
$('.copy_link').click(function () { |
|
63
|
|
|
window.prompt(t('polls','Copy to clipboard: Ctrl+C, Enter'), $(this).data('url')); |
|
64
|
|
|
}); |
|
65
|
|
|
}); |
|
66
|
|
|
|